#include<iostream>
#include<string>
#include<string.h>
#include<stdio.h>
#define MAX 100

using namespace std;

int cases;
string phrase = "the quick brown fox jumps over the lazy dog";
int alphabet[26];
string lines[MAX+1];
bool found;

bool Break(string line)
{
	for(int i=0; i<26; i++)
		alphabet[i] = 0;
	int i;
	for(i=0; i < line.length(); i++)
	{
		if(line[i] != ' ')
			if(alphabet[line[i]-'a'] && alphabet[line[i]-'a'] != (int)phrase[i])
				break;
			else
				alphabet[line[i]-'a'] = (int)phrase[i];
		else
			if(phrase[i] != ' ')
				break;
	}
	if(i == phrase.length())
		return true;
	return false;
}

void solve(int boundarie)
{
	for(int i=0; i<boundarie; i++)
	{
		for(int j=0; j<lines[i].length(); j++)
		{
			if(lines[i][j] != ' ')
				cout << (char)alphabet[lines[i][j]-'a'];
			else
				cout << ' ';
		}
		cout << endl;
	}
}

void read()
{
	string tmp;
	cin >> cases;
	
	getchar();
	getline(cin, tmp);
	
	while(cases--)
	{
		found = false;
		int i = 0;
		while(getline(cin, lines[i]))
		{
			if(lines[i].length() == 0)
				break;
			if(lines[i].length() == phrase.length() && !found)
			{
				if(Break(lines[i]))
					found = true;
			}
			i++;
		}
		if(found)
			solve(i);
		else
			cout << "No solution." << endl;
		if(cases)
			cout << endl;
	}
}

int main()
{
	read();
	return 0;
}
